{"cells":[{"cell_type":"code","execution_count":1,"metadata":{"collapsed":false,"id":"D4BE8B08FB774697A81A5347FB60E776","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"skip"},"tags":[],"trusted":true},"outputs":[],"source":["# # 如果没有安装 pyecharts 可以将下面一行命令注释去掉之后并运行\n","# !pip install pyecharts"]},{"cell_type":"markdown","metadata":{"collapsed":false,"id":"D98414F37BD44F64906BCCD84DA0B316","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"source":["# Part4 | 扩展：Bokeh与Pyechart 的介绍与使用（下）"]},{"cell_type":"markdown","metadata":{"collapsed":false,"id":"13145089B3694F4DAB9112FDD09A6F7A","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"source":["## Pyecharts 简介\n","\n","\n","![Echarts Logo](https://cdn.kesci.com/upload/image/rfx7t6vogi.png?imageView2/0/w/960/h/960)\n"]},{"cell_type":"code","execution_count":2,"metadata":{"collapsed":false,"id":"E3893F7135394B9B964FB4803C2DC4CE","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":true,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"outputs":[{"data":{"text/html":["\n","        <iframe\n","            width=\"1220\"\n","            height=\"900\"\n","            src=\"https://echarts.apache.org/zh/index.html\"\n","            frameborder=\"0\"\n","            allowfullscreen\n","            \n","        ></iframe>\n","        "],"text/plain":["<IPython.lib.display.IFrame at 0x109676cb0>"]},"execution_count":2,"metadata":{},"output_type":"execute_result"}],"source":["from IPython.display import IFrame\n","IFrame(\"https://echarts.apache.org/zh/index.html\", width=1220, height=900)"]},{"cell_type":"markdown","metadata":{"collapsed":false,"id":"E2A7376004424788A87598EB36977A69","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"source":["\n","[Pyecharts](https://pyecharts.org/#/) 是基于 [Echarts](https://echarts.apache.org/zh/index.html) 的 Python 实现：\n","\n","- 提供了 30 几种图形的绘制接口\n","- 对「中文」完美支持\n","- 简单易用"]},{"cell_type":"markdown","metadata":{"collapsed":false,"id":"1CAB7295C96B41FCBDB5F012B7E228E1","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"source":["## Pyecharts 使用公式\n"]},{"cell_type":"markdown","metadata":{"collapsed":false,"id":"DBE1C4160C8D40C686BC81DE7C9B0195","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"source":["\n","$$\n","\\begin{aligned}\n","Pyecharts &= \\text{选择基本图形 📊}\\\\\n","          &+ \\text{加入与图形相关的数据与参数 🛠}\\\\\n","          &+ \\text{再来亿点点细节 🤏}\\\\\n","          &+ \\text{渲染 📝}\n","\\end{aligned}\n","$$\n"]},{"cell_type":"markdown","metadata":{"collapsed":false,"id":"48D5F0FCFC6A440385F7CE96C0E695B6","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"source":["## 一个例子\n","\n","基于 Pyecharts 官方文档的 [Calendar Heatmap 示例](https://gallery.pyecharts.org/#/Calendar/calendar_heatmap) 而实现类似于 Github Contribution Graph：\n","\n","\n","![Image Name](https://cdn.kesci.com/upload/image/rfx88egp8c.jpg?imageView2/0/w/960/h/960)\n"]},{"cell_type":"code","execution_count":3,"metadata":{"collapsed":false,"id":"BB6D8D3F591C4215A9BCE8DD88B31915","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"outputs":[{"data":{"text/plain":["[['2021-01-02', 21301],\n"," ['2021-01-03', 1201],\n"," ['2021-01-04', 9634],\n"," ['2021-01-05', 2207],\n"," ['2021-01-06', 14848],\n"," ['2021-01-07', 13411],\n"," ['2021-01-08', 18566],\n"," ['2021-01-09', 7173],\n"," ['2021-01-10', 18995]]"]},"execution_count":3,"metadata":{},"output_type":"execute_result"}],"source":["import random\n","import datetime\n","\n","import pyecharts.options as opts\n","from pyecharts.charts import Calendar\n","\n","\n","begin = datetime.date(2021, 1, 1)\n","end = datetime.date(2021, 12, 31)\n","data = [\n","    [str(begin + datetime.timedelta(days=i)), random.randint(1000, 25000)]\n","    for i in range((end - begin).days + 1)\n","]\n","data[1:10]"]},{"cell_type":"code","execution_count":4,"metadata":{"collapsed":false,"id":"2AB5D0D71A294394B168D390E68CBEED","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"outputs":[{"data":{"text/html":["\n","<script>\n","    require.config({\n","        paths: {\n","            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n","        }\n","    });\n","</script>\n","\n","        <div id=\"fcb366d4d463481ebdb45173cf8ed6f4\" style=\"width:1600px; height:300px;\"></div>\n","\n","<script>\n","        require(['echarts'], function(echarts) {\n","                var chart_fcb366d4d463481ebdb45173cf8ed6f4 = echarts.init(\n","                    document.getElementById('fcb366d4d463481ebdb45173cf8ed6f4'), 'white', {renderer: 'canvas'});\n","                var option_fcb366d4d463481ebdb45173cf8ed6f4 = {\n","    \"animation\": true,\n","    \"animationThreshold\": 2000,\n","    \"animationDuration\": 1000,\n","    \"animationEasing\": \"cubicOut\",\n","    \"animationDelay\": 0,\n","    \"animationDurationUpdate\": 300,\n","    \"animationEasingUpdate\": \"cubicOut\",\n","    \"animationDelayUpdate\": 0,\n","    \"color\": [\n","        \"#c23531\",\n","        \"#2f4554\",\n","        \"#61a0a8\",\n","        \"#d48265\",\n","        \"#749f83\",\n","        \"#ca8622\",\n","        \"#bda29a\",\n","        \"#6e7074\",\n","        \"#546570\",\n","        \"#c4ccd3\",\n","        \"#f05b72\",\n","        \"#ef5b9c\",\n","        \"#f47920\",\n","        \"#905a3d\",\n","        \"#fab27b\",\n","        \"#2a5caa\",\n","        \"#444693\",\n","        \"#726930\",\n","        \"#b2d235\",\n","        \"#6d8346\",\n","        \"#ac6767\",\n","        \"#1d953f\",\n","        \"#6950a1\",\n","        \"#918597\"\n","    ],\n","    \"series\": [\n","        {\n","            \"type\": \"heatmap\",\n","            \"coordinateSystem\": \"calendar\",\n","            \"data\": [\n","                [\n","                    \"2021-01-01\",\n","                    4829\n","                ],\n","                [\n","                    \"2021-01-02\",\n","                    21301\n","                ],\n","                [\n","                    \"2021-01-03\",\n","                    1201\n","                ],\n","                [\n","                    \"2021-01-04\",\n","                    9634\n","                ],\n","                [\n","                    \"2021-01-05\",\n","                    2207\n","                ],\n","                [\n","                    \"2021-01-06\",\n","                    14848\n","                ],\n","                [\n","                    \"2021-01-07\",\n","                    13411\n","                ],\n","                [\n","                    \"2021-01-08\",\n","                    18566\n","                ],\n","                [\n","                    \"2021-01-09\",\n","                    7173\n","                ],\n","                [\n","                    \"2021-01-10\",\n","                    18995\n","                ],\n","                [\n","                    \"2021-01-11\",\n","                    4139\n","                ],\n","                [\n","                    \"2021-01-12\",\n","                    6424\n","                ],\n","                [\n","                    \"2021-01-13\",\n","                    7954\n","                ],\n","                [\n","                    \"2021-01-14\",\n","                    13802\n","                ],\n","                [\n","                    \"2021-01-15\",\n","                    9701\n","                ],\n","                [\n","                    \"2021-01-16\",\n","                    4396\n","                ],\n","                [\n","                    \"2021-01-17\",\n","                    6270\n","                ],\n","                [\n","                    \"2021-01-18\",\n","                    1488\n","                ],\n","                [\n","                    \"2021-01-19\",\n","                    1026\n","                ],\n","                [\n","                    \"2021-01-20\",\n","                    8159\n","                ],\n","                [\n","                    \"2021-01-21\",\n","                    22632\n","                ],\n","                [\n","                    \"2021-01-22\",\n","                    7859\n","                ],\n","                [\n","                    \"2021-01-23\",\n","                    11700\n","                ],\n","                [\n","                    \"2021-01-24\",\n","                    17700\n","                ],\n","                [\n","                    \"2021-01-25\",\n","                    16913\n","                ],\n","                [\n","                    \"2021-01-26\",\n","                    19115\n","                ],\n","                [\n","                    \"2021-01-27\",\n","                    24743\n","                ],\n","                [\n","                    \"2021-01-28\",\n","                    23720\n","                ],\n","                [\n","                    \"2021-01-29\",\n","                    14896\n","                ],\n","                [\n","                    \"2021-01-30\",\n","                    18865\n","                ],\n","                [\n","                    \"2021-01-31\",\n","                    12939\n","                ],\n","                [\n","                    \"2021-02-01\",\n","                    13332\n","                ],\n","                [\n","                    \"2021-02-02\",\n","                    7404\n","                ],\n","                [\n","                    \"2021-02-03\",\n","                    15017\n","                ],\n","                [\n","                    \"2021-02-04\",\n","                    1860\n","                ],\n","                [\n","                    \"2021-02-05\",\n","                    6436\n","                ],\n","                [\n","                    \"2021-02-06\",\n","                    23638\n","                ],\n","                [\n","                    \"2021-02-07\",\n","                    13852\n","                ],\n","                [\n","                    \"2021-02-08\",\n","                    10962\n","                ],\n","                [\n","                    \"2021-02-09\",\n","                    20198\n","                ],\n","                [\n","                    \"2021-02-10\",\n","                    9974\n","                ],\n","                [\n","                    \"2021-02-11\",\n","                    24855\n","                ],\n","                [\n","                    \"2021-02-12\",\n","                    24752\n","                ],\n","                [\n","                    \"2021-02-13\",\n","                    12466\n","                ],\n","                [\n","                    \"2021-02-14\",\n","                    21032\n","                ],\n","                [\n","                    \"2021-02-15\",\n","                    4239\n","                ],\n","                [\n","                    \"2021-02-16\",\n","                    20030\n","                ],\n","                [\n","                    \"2021-02-17\",\n","                    9171\n","                ],\n","                [\n","                    \"2021-02-18\",\n","                    5282\n","                ],\n","                [\n","                    \"2021-02-19\",\n","                    21099\n","                ],\n","                [\n","                    \"2021-02-20\",\n","                    14485\n","                ],\n","                [\n","                    \"2021-02-21\",\n","                    5413\n","                ],\n","                [\n","                    \"2021-02-22\",\n","                    11691\n","                ],\n","                [\n","                    \"2021-02-23\",\n","                    16736\n","                ],\n","                [\n","                    \"2021-02-24\",\n","                    4863\n","                ],\n","                [\n","                    \"2021-02-25\",\n","                    12850\n","                ],\n","                [\n","                    \"2021-02-26\",\n","                    20123\n","                ],\n","                [\n","                    \"2021-02-27\",\n","                    20842\n","                ],\n","                [\n","                    \"2021-02-28\",\n","                    21372\n","                ],\n","                [\n","                    \"2021-03-01\",\n","                    23880\n","                ],\n","                [\n","                    \"2021-03-02\",\n","                    18751\n","                ],\n","                [\n","                    \"2021-03-03\",\n","                    19117\n","                ],\n","                [\n","                    \"2021-03-04\",\n","                    24573\n","                ],\n","                [\n","                    \"2021-03-05\",\n","                    14134\n","                ],\n","                [\n","                    \"2021-03-06\",\n","                    12916\n","                ],\n","                [\n","                    \"2021-03-07\",\n","                    14951\n","                ],\n","                [\n","                    \"2021-03-08\",\n","                    19380\n","                ],\n","                [\n","                    \"2021-03-09\",\n","                    2093\n","                ],\n","                [\n","                    \"2021-03-10\",\n","                    12695\n","                ],\n","                [\n","                    \"2021-03-11\",\n","                    3856\n","                ],\n","                [\n","                    \"2021-03-12\",\n","                    18445\n","                ],\n","                [\n","                    \"2021-03-13\",\n","                    1677\n","                ],\n","                [\n","                    \"2021-03-14\",\n","                    11830\n","                ],\n","                [\n","                    \"2021-03-15\",\n","                    16063\n","                ],\n","                [\n","                    \"2021-03-16\",\n","                    4448\n","                ],\n","                [\n","                    \"2021-03-17\",\n","                    5342\n","                ],\n","                [\n","                    \"2021-03-18\",\n","                    4861\n","                ],\n","                [\n","                    \"2021-03-19\",\n","                    2967\n","                ],\n","                [\n","                    \"2021-03-20\",\n","                    18143\n","                ],\n","                [\n","                    \"2021-03-21\",\n","                    3499\n","                ],\n","                [\n","                    \"2021-03-22\",\n","                    19042\n","                ],\n","                [\n","                    \"2021-03-23\",\n","                    19229\n","                ],\n","                [\n","                    \"2021-03-24\",\n","                    4646\n","                ],\n","                [\n","                    \"2021-03-25\",\n","                    17517\n","                ],\n","                [\n","                    \"2021-03-26\",\n","                    20172\n","                ],\n","                [\n","                    \"2021-03-27\",\n","                    19698\n","                ],\n","                [\n","                    \"2021-03-28\",\n","                    5152\n","                ],\n","                [\n","                    \"2021-03-29\",\n","                    18429\n","                ],\n","                [\n","                    \"2021-03-30\",\n","                    8099\n","                ],\n","                [\n","                    \"2021-03-31\",\n","                    9282\n","                ],\n","                [\n","                    \"2021-04-01\",\n","                    12111\n","                ],\n","                [\n","                    \"2021-04-02\",\n","                    19418\n","                ],\n","                [\n","                    \"2021-04-03\",\n","                    6444\n","                ],\n","                [\n","                    \"2021-04-04\",\n","                    13235\n","                ],\n","                [\n","                    \"2021-04-05\",\n","                    13699\n","                ],\n","                [\n","                    \"2021-04-06\",\n","                    18754\n","                ],\n","                [\n","                    \"2021-04-07\",\n","                    23770\n","                ],\n","                [\n","                    \"2021-04-08\",\n","                    22140\n","                ],\n","                [\n","                    \"2021-04-09\",\n","                    21652\n","                ],\n","                [\n","                    \"2021-04-10\",\n","                    17348\n","                ],\n","                [\n","                    \"2021-04-11\",\n","                    17978\n","                ],\n","                [\n","                    \"2021-04-12\",\n","                    6682\n","                ],\n","                [\n","                    \"2021-04-13\",\n","                    15662\n","                ],\n","                [\n","                    \"2021-04-14\",\n","                    18285\n","                ],\n","                [\n","                    \"2021-04-15\",\n","                    5115\n","                ],\n","                [\n","                    \"2021-04-16\",\n","                    18237\n","                ],\n","                [\n","                    \"2021-04-17\",\n","                    12963\n","                ],\n","                [\n","                    \"2021-04-18\",\n","                    20634\n","                ],\n","                [\n","                    \"2021-04-19\",\n","                    9062\n","                ],\n","                [\n","                    \"2021-04-20\",\n","                    18568\n","                ],\n","                [\n","                    \"2021-04-21\",\n","                    8800\n","                ],\n","                [\n","                    \"2021-04-22\",\n","                    11497\n","                ],\n","                [\n","                    \"2021-04-23\",\n","                    24455\n","                ],\n","                [\n","                    \"2021-04-24\",\n","                    4823\n","                ],\n","                [\n","                    \"2021-04-25\",\n","                    18392\n","                ],\n","                [\n","                    \"2021-04-26\",\n","                    3301\n","                ],\n","                [\n","                    \"2021-04-27\",\n","                    5757\n","                ],\n","                [\n","                    \"2021-04-28\",\n","                    3424\n","                ],\n","                [\n","                    \"2021-04-29\",\n","                    14142\n","                ],\n","                [\n","                    \"2021-04-30\",\n","                    15630\n","                ],\n","                [\n","                    \"2021-05-01\",\n","                    21807\n","                ],\n","                [\n","                    \"2021-05-02\",\n","                    12964\n","                ],\n","                [\n","                    \"2021-05-03\",\n","                    6261\n","                ],\n","                [\n","                    \"2021-05-04\",\n","                    19468\n","                ],\n","                [\n","                    \"2021-05-05\",\n","                    17556\n","                ],\n","                [\n","                    \"2021-05-06\",\n","                    14076\n","                ],\n","                [\n","                    \"2021-05-07\",\n","                    18479\n","                ],\n","                [\n","                    \"2021-05-08\",\n","                    19643\n","                ],\n","                [\n","                    \"2021-05-09\",\n","                    20023\n","                ],\n","                [\n","                    \"2021-05-10\",\n","                    22367\n","                ],\n","                [\n","                    \"2021-05-11\",\n","                    21395\n","                ],\n","                [\n","                    \"2021-05-12\",\n","                    2319\n","                ],\n","                [\n","                    \"2021-05-13\",\n","                    23368\n","                ],\n","                [\n","                    \"2021-05-14\",\n","                    5796\n","                ],\n","                [\n","                    \"2021-05-15\",\n","                    10772\n","                ],\n","                [\n","                    \"2021-05-16\",\n","                    13052\n","                ],\n","                [\n","                    \"2021-05-17\",\n","                    13228\n","                ],\n","                [\n","                    \"2021-05-18\",\n","                    15161\n","                ],\n","                [\n","                    \"2021-05-19\",\n","                    4185\n","                ],\n","                [\n","                    \"2021-05-20\",\n","                    1044\n","                ],\n","                [\n","                    \"2021-05-21\",\n","                    23702\n","                ],\n","                [\n","                    \"2021-05-22\",\n","                    23721\n","                ],\n","                [\n","                    \"2021-05-23\",\n","                    2197\n","                ],\n","                [\n","                    \"2021-05-24\",\n","                    7781\n","                ],\n","                [\n","                    \"2021-05-25\",\n","                    20715\n","                ],\n","                [\n","                    \"2021-05-26\",\n","                    21403\n","                ],\n","                [\n","                    \"2021-05-27\",\n","                    9107\n","                ],\n","                [\n","                    \"2021-05-28\",\n","                    2336\n","                ],\n","                [\n","                    \"2021-05-29\",\n","                    7572\n","                ],\n","                [\n","                    \"2021-05-30\",\n","                    24631\n","                ],\n","                [\n","                    \"2021-05-31\",\n","                    2663\n","                ],\n","                [\n","                    \"2021-06-01\",\n","                    7164\n","                ],\n","                [\n","                    \"2021-06-02\",\n","                    7887\n","                ],\n","                [\n","                    \"2021-06-03\",\n","                    14994\n","                ],\n","                [\n","                    \"2021-06-04\",\n","                    17432\n","                ],\n","                [\n","                    \"2021-06-05\",\n","                    19153\n","                ],\n","                [\n","                    \"2021-06-06\",\n","                    2293\n","                ],\n","                [\n","                    \"2021-06-07\",\n","                    4967\n","                ],\n","                [\n","                    \"2021-06-08\",\n","                    21793\n","                ],\n","                [\n","                    \"2021-06-09\",\n","                    15236\n","                ],\n","                [\n","                    \"2021-06-10\",\n","                    4612\n","                ],\n","                [\n","                    \"2021-06-11\",\n","                    17611\n","                ],\n","                [\n","                    \"2021-06-12\",\n","                    23855\n","                ],\n","                [\n","                    \"2021-06-13\",\n","                    14495\n","                ],\n","                [\n","                    \"2021-06-14\",\n","                    4883\n","                ],\n","                [\n","                    \"2021-06-15\",\n","                    6313\n","                ],\n","                [\n","                    \"2021-06-16\",\n","                    11839\n","                ],\n","                [\n","                    \"2021-06-17\",\n","                    8239\n","                ],\n","                [\n","                    \"2021-06-18\",\n","                    11160\n","                ],\n","                [\n","                    \"2021-06-19\",\n","                    24589\n","                ],\n","                [\n","                    \"2021-06-20\",\n","                    16404\n","                ],\n","                [\n","                    \"2021-06-21\",\n","                    5239\n","                ],\n","                [\n","                    \"2021-06-22\",\n","                    18634\n","                ],\n","                [\n","                    \"2021-06-23\",\n","                    6736\n","                ],\n","                [\n","                    \"2021-06-24\",\n","                    16921\n","                ],\n","                [\n","                    \"2021-06-25\",\n","                    9842\n","                ],\n","                [\n","                    \"2021-06-26\",\n","                    15055\n","                ],\n","                [\n","                    \"2021-06-27\",\n","                    13110\n","                ],\n","                [\n","                    \"2021-06-28\",\n","                    10473\n","                ],\n","                [\n","                    \"2021-06-29\",\n","                    20795\n","                ],\n","                [\n","                    \"2021-06-30\",\n","                    5908\n","                ],\n","                [\n","                    \"2021-07-01\",\n","                    23457\n","                ],\n","                [\n","                    \"2021-07-02\",\n","                    5735\n","                ],\n","                [\n","                    \"2021-07-03\",\n","                    19873\n","                ],\n","                [\n","                    \"2021-07-04\",\n","                    3977\n","                ],\n","                [\n","                    \"2021-07-05\",\n","                    10578\n","                ],\n","                [\n","                    \"2021-07-06\",\n","                    5989\n","                ],\n","                [\n","                    \"2021-07-07\",\n","                    16544\n","                ],\n","                [\n","                    \"2021-07-08\",\n","                    14688\n","                ],\n","                [\n","                    \"2021-07-09\",\n","                    1343\n","                ],\n","                [\n","                    \"2021-07-10\",\n","                    7788\n","                ],\n","                [\n","                    \"2021-07-11\",\n","                    5863\n","                ],\n","                [\n","                    \"2021-07-12\",\n","                    19324\n","                ],\n","                [\n","                    \"2021-07-13\",\n","                    3545\n","                ],\n","                [\n","                    \"2021-07-14\",\n","                    19073\n","                ],\n","                [\n","                    \"2021-07-15\",\n","                    10288\n","                ],\n","                [\n","                    \"2021-07-16\",\n","                    13791\n","                ],\n","                [\n","                    \"2021-07-17\",\n","                    1446\n","                ],\n","                [\n","                    \"2021-07-18\",\n","                    18825\n","                ],\n","                [\n","                    \"2021-07-19\",\n","                    24204\n","                ],\n","                [\n","                    \"2021-07-20\",\n","                    14437\n","                ],\n","                [\n","                    \"2021-07-21\",\n","                    18387\n","                ],\n","                [\n","                    \"2021-07-22\",\n","                    9868\n","                ],\n","                [\n","                    \"2021-07-23\",\n","                    21187\n","                ],\n","                [\n","                    \"2021-07-24\",\n","                    24946\n","                ],\n","                [\n","                    \"2021-07-25\",\n","                    16723\n","                ],\n","                [\n","                    \"2021-07-26\",\n","                    6041\n","                ],\n","                [\n","                    \"2021-07-27\",\n","                    21625\n","                ],\n","                [\n","                    \"2021-07-28\",\n","                    15843\n","                ],\n","                [\n","                    \"2021-07-29\",\n","                    12153\n","                ],\n","                [\n","                    \"2021-07-30\",\n","                    11078\n","                ],\n","                [\n","                    \"2021-07-31\",\n","                    18664\n","                ],\n","                [\n","                    \"2021-08-01\",\n","                    17401\n","                ],\n","                [\n","                    \"2021-08-02\",\n","                    1273\n","                ],\n","                [\n","                    \"2021-08-03\",\n","                    10392\n","                ],\n","                [\n","                    \"2021-08-04\",\n","                    15850\n","                ],\n","                [\n","                    \"2021-08-05\",\n","                    22757\n","                ],\n","                [\n","                    \"2021-08-06\",\n","                    8687\n","                ],\n","                [\n","                    \"2021-08-07\",\n","                    24848\n","                ],\n","                [\n","                    \"2021-08-08\",\n","                    16093\n","                ],\n","                [\n","                    \"2021-08-09\",\n","                    16877\n","                ],\n","                [\n","                    \"2021-08-10\",\n","                    2188\n","                ],\n","                [\n","                    \"2021-08-11\",\n","                    24577\n","                ],\n","                [\n","                    \"2021-08-12\",\n","                    20140\n","                ],\n","                [\n","                    \"2021-08-13\",\n","                    22829\n","                ],\n","                [\n","                    \"2021-08-14\",\n","                    7063\n","                ],\n","                [\n","                    \"2021-08-15\",\n","                    2436\n","                ],\n","                [\n","                    \"2021-08-16\",\n","                    12253\n","                ],\n","                [\n","                    \"2021-08-17\",\n","                    11326\n","                ],\n","                [\n","                    \"2021-08-18\",\n","                    10260\n","                ],\n","                [\n","                    \"2021-08-19\",\n","                    7153\n","                ],\n","                [\n","                    \"2021-08-20\",\n","                    19399\n","                ],\n","                [\n","                    \"2021-08-21\",\n","                    1674\n","                ],\n","                [\n","                    \"2021-08-22\",\n","                    10786\n","                ],\n","                [\n","                    \"2021-08-23\",\n","                    10780\n","                ],\n","                [\n","                    \"2021-08-24\",\n","                    3121\n","                ],\n","                [\n","                    \"2021-08-25\",\n","                    12259\n","                ],\n","                [\n","                    \"2021-08-26\",\n","                    9767\n","                ],\n","                [\n","                    \"2021-08-27\",\n","                    16524\n","                ],\n","                [\n","                    \"2021-08-28\",\n","                    10514\n","                ],\n","                [\n","                    \"2021-08-29\",\n","                    1794\n","                ],\n","                [\n","                    \"2021-08-30\",\n","                    7878\n","                ],\n","                [\n","                    \"2021-08-31\",\n","                    12961\n","                ],\n","                [\n","                    \"2021-09-01\",\n","                    9417\n","                ],\n","                [\n","                    \"2021-09-02\",\n","                    23513\n","                ],\n","                [\n","                    \"2021-09-03\",\n","                    5352\n","                ],\n","                [\n","                    \"2021-09-04\",\n","                    16107\n","                ],\n","                [\n","                    \"2021-09-05\",\n","                    3820\n","                ],\n","                [\n","                    \"2021-09-06\",\n","                    17524\n","                ],\n","                [\n","                    \"2021-09-07\",\n","                    17798\n","                ],\n","                [\n","                    \"2021-09-08\",\n","                    10304\n","                ],\n","                [\n","                    \"2021-09-09\",\n","                    16065\n","                ],\n","                [\n","                    \"2021-09-10\",\n","                    19514\n","                ],\n","                [\n","                    \"2021-09-11\",\n","                    4277\n","                ],\n","                [\n","                    \"2021-09-12\",\n","                    19111\n","                ],\n","                [\n","                    \"2021-09-13\",\n","                    8667\n","                ],\n","                [\n","                    \"2021-09-14\",\n","                    9524\n","                ],\n","                [\n","                    \"2021-09-15\",\n","                    23636\n","                ],\n","                [\n","                    \"2021-09-16\",\n","                    24679\n","                ],\n","                [\n","                    \"2021-09-17\",\n","                    20266\n","                ],\n","                [\n","                    \"2021-09-18\",\n","                    15946\n","                ],\n","                [\n","                    \"2021-09-19\",\n","                    16691\n","                ],\n","                [\n","                    \"2021-09-20\",\n","                    22412\n","                ],\n","                [\n","                    \"2021-09-21\",\n","                    5671\n","                ],\n","                [\n","                    \"2021-09-22\",\n","                    12607\n","                ],\n","                [\n","                    \"2021-09-23\",\n","                    19000\n","                ],\n","                [\n","                    \"2021-09-24\",\n","                    14457\n","                ],\n","                [\n","                    \"2021-09-25\",\n","                    24498\n","                ],\n","                [\n","                    \"2021-09-26\",\n","                    14777\n","                ],\n","                [\n","                    \"2021-09-27\",\n","                    7736\n","                ],\n","                [\n","                    \"2021-09-28\",\n","                    17455\n","                ],\n","                [\n","                    \"2021-09-29\",\n","                    12278\n","                ],\n","                [\n","                    \"2021-09-30\",\n","                    17856\n","                ],\n","                [\n","                    \"2021-10-01\",\n","                    5884\n","                ],\n","                [\n","                    \"2021-10-02\",\n","                    16191\n","                ],\n","                [\n","                    \"2021-10-03\",\n","                    8135\n","                ],\n","                [\n","                    \"2021-10-04\",\n","                    8785\n","                ],\n","                [\n","                    \"2021-10-05\",\n","                    13251\n","                ],\n","                [\n","                    \"2021-10-06\",\n","                    24922\n","                ],\n","                [\n","                    \"2021-10-07\",\n","                    16325\n","                ],\n","                [\n","                    \"2021-10-08\",\n","                    11566\n","                ],\n","                [\n","                    \"2021-10-09\",\n","                    15290\n","                ],\n","                [\n","                    \"2021-10-10\",\n","                    22890\n","                ],\n","                [\n","                    \"2021-10-11\",\n","                    3796\n","                ],\n","                [\n","                    \"2021-10-12\",\n","                    24590\n","                ],\n","                [\n","                    \"2021-10-13\",\n","                    6364\n","                ],\n","                [\n","                    \"2021-10-14\",\n","                    3926\n","                ],\n","                [\n","                    \"2021-10-15\",\n","                    15067\n","                ],\n","                [\n","                    \"2021-10-16\",\n","                    22918\n","                ],\n","                [\n","                    \"2021-10-17\",\n","                    5578\n","                ],\n","                [\n","                    \"2021-10-18\",\n","                    6580\n","                ],\n","                [\n","                    \"2021-10-19\",\n","                    16198\n","                ],\n","                [\n","                    \"2021-10-20\",\n","                    13753\n","                ],\n","                [\n","                    \"2021-10-21\",\n","                    15059\n","                ],\n","                [\n","                    \"2021-10-22\",\n","                    20214\n","                ],\n","                [\n","                    \"2021-10-23\",\n","                    6993\n","                ],\n","                [\n","                    \"2021-10-24\",\n","                    7126\n","                ],\n","                [\n","                    \"2021-10-25\",\n","                    15493\n","                ],\n","                [\n","                    \"2021-10-26\",\n","                    20155\n","                ],\n","                [\n","                    \"2021-10-27\",\n","                    12614\n","                ],\n","                [\n","                    \"2021-10-28\",\n","                    24412\n","                ],\n","                [\n","                    \"2021-10-29\",\n","                    11134\n","                ],\n","                [\n","                    \"2021-10-30\",\n","                    7424\n","                ],\n","                [\n","                    \"2021-10-31\",\n","                    19539\n","                ],\n","                [\n","                    \"2021-11-01\",\n","                    4992\n","                ],\n","                [\n","                    \"2021-11-02\",\n","                    8254\n","                ],\n","                [\n","                    \"2021-11-03\",\n","                    14691\n","                ],\n","                [\n","                    \"2021-11-04\",\n","                    8939\n","                ],\n","                [\n","                    \"2021-11-05\",\n","                    12206\n","                ],\n","                [\n","                    \"2021-11-06\",\n","                    14177\n","                ],\n","                [\n","                    \"2021-11-07\",\n","                    7892\n","                ],\n","                [\n","                    \"2021-11-08\",\n","                    13951\n","                ],\n","                [\n","                    \"2021-11-09\",\n","                    17992\n","                ],\n","                [\n","                    \"2021-11-10\",\n","                    12582\n","                ],\n","                [\n","                    \"2021-11-11\",\n","                    22671\n","                ],\n","                [\n","                    \"2021-11-12\",\n","                    19951\n","                ],\n","                [\n","                    \"2021-11-13\",\n","                    10993\n","                ],\n","                [\n","                    \"2021-11-14\",\n","                    17433\n","                ],\n","                [\n","                    \"2021-11-15\",\n","                    14918\n","                ],\n","                [\n","                    \"2021-11-16\",\n","                    19907\n","                ],\n","                [\n","                    \"2021-11-17\",\n","                    23396\n","                ],\n","                [\n","                    \"2021-11-18\",\n","                    20143\n","                ],\n","                [\n","                    \"2021-11-19\",\n","                    17867\n","                ],\n","                [\n","                    \"2021-11-20\",\n","                    14242\n","                ],\n","                [\n","                    \"2021-11-21\",\n","                    22089\n","                ],\n","                [\n","                    \"2021-11-22\",\n","                    17838\n","                ],\n","                [\n","                    \"2021-11-23\",\n","                    3397\n","                ],\n","                [\n","                    \"2021-11-24\",\n","                    23479\n","                ],\n","                [\n","                    \"2021-11-25\",\n","                    2610\n","                ],\n","                [\n","                    \"2021-11-26\",\n","                    23642\n","                ],\n","                [\n","                    \"2021-11-27\",\n","                    4817\n","                ],\n","                [\n","                    \"2021-11-28\",\n","                    15600\n","                ],\n","                [\n","                    \"2021-11-29\",\n","                    23466\n","                ],\n","                [\n","                    \"2021-11-30\",\n","                    20638\n","                ],\n","                [\n","                    \"2021-12-01\",\n","                    18773\n","                ],\n","                [\n","                    \"2021-12-02\",\n","                    6322\n","                ],\n","                [\n","                    \"2021-12-03\",\n","                    24649\n","                ],\n","                [\n","                    \"2021-12-04\",\n","                    17559\n","                ],\n","                [\n","                    \"2021-12-05\",\n","                    1954\n","                ],\n","                [\n","                    \"2021-12-06\",\n","                    5401\n","                ],\n","                [\n","                    \"2021-12-07\",\n","                    21978\n","                ],\n","                [\n","                    \"2021-12-08\",\n","                    5566\n","                ],\n","                [\n","                    \"2021-12-09\",\n","                    8372\n","                ],\n","                [\n","                    \"2021-12-10\",\n","                    4649\n","                ],\n","                [\n","                    \"2021-12-11\",\n","                    10153\n","                ],\n","                [\n","                    \"2021-12-12\",\n","                    2301\n","                ],\n","                [\n","                    \"2021-12-13\",\n","                    3440\n","                ],\n","                [\n","                    \"2021-12-14\",\n","                    20421\n","                ],\n","                [\n","                    \"2021-12-15\",\n","                    15635\n","                ],\n","                [\n","                    \"2021-12-16\",\n","                    14260\n","                ],\n","                [\n","                    \"2021-12-17\",\n","                    12748\n","                ],\n","                [\n","                    \"2021-12-18\",\n","                    22939\n","                ],\n","                [\n","                    \"2021-12-19\",\n","                    10173\n","                ],\n","                [\n","                    \"2021-12-20\",\n","                    18502\n","                ],\n","                [\n","                    \"2021-12-21\",\n","                    12690\n","                ],\n","                [\n","                    \"2021-12-22\",\n","                    4931\n","                ],\n","                [\n","                    \"2021-12-23\",\n","                    22855\n","                ],\n","                [\n","                    \"2021-12-24\",\n","                    17099\n","                ],\n","                [\n","                    \"2021-12-25\",\n","                    5533\n","                ],\n","                [\n","                    \"2021-12-26\",\n","                    22571\n","                ],\n","                [\n","                    \"2021-12-27\",\n","                    19687\n","                ],\n","                [\n","                    \"2021-12-28\",\n","                    21652\n","                ],\n","                [\n","                    \"2021-12-29\",\n","                    15306\n","                ],\n","                [\n","                    \"2021-12-30\",\n","                    21575\n","                ],\n","                [\n","                    \"2021-12-31\",\n","                    24236\n","                ]\n","            ],\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            }\n","        }\n","    ],\n","    \"legend\": [\n","        {\n","            \"data\": [\n","                \"\"\n","            ],\n","            \"selected\": {\n","                \"\": true\n","            },\n","            \"show\": true,\n","            \"padding\": 5,\n","            \"itemGap\": 10,\n","            \"itemWidth\": 25,\n","            \"itemHeight\": 14\n","        }\n","    ],\n","    \"tooltip\": {\n","        \"show\": true,\n","        \"trigger\": \"item\",\n","        \"triggerOn\": \"mousemove|click\",\n","        \"axisPointer\": {\n","            \"type\": \"line\"\n","        },\n","        \"showContent\": true,\n","        \"alwaysShowContent\": false,\n","        \"showDelay\": 0,\n","        \"hideDelay\": 100,\n","        \"textStyle\": {\n","            \"fontSize\": 14\n","        },\n","        \"borderWidth\": 0,\n","        \"padding\": 5\n","    },\n","    \"calendar\": {\n","        \"top\": \"120\",\n","        \"width\": \"auto\",\n","        \"orient\": \"horizontal\",\n","        \"range\": \"2021\",\n","        \"cellSize\": 20,\n","        \"dayLabel\": {\n","            \"show\": true,\n","            \"firstDay\": 1,\n","            \"position\": \"start\",\n","            \"nameMap\": \"cn\",\n","            \"color\": \"#000\",\n","            \"fontStyle\": \"normal\",\n","            \"fontWeight\": \"normal\",\n","            \"fontFamily\": \"sans-serif\",\n","            \"fontSize\": 12\n","        },\n","        \"monthLabel\": {\n","            \"show\": true,\n","            \"position\": \"start\",\n","            \"nameMap\": \"cn\",\n","            \"color\": \"#000\",\n","            \"fontStyle\": \"normal\",\n","            \"fontWeight\": \"normal\",\n","            \"fontFamily\": \"sans-serif\",\n","            \"fontSize\": 12\n","        },\n","        \"yearLabel\": {\n","            \"show\": false,\n","            \"color\": \"#000\",\n","            \"fontStyle\": \"normal\",\n","            \"fontWeight\": \"normal\",\n","            \"fontFamily\": \"sans-serif\",\n","            \"fontSize\": 12\n","        }\n","    },\n","    \"title\": [\n","        {\n","            \"text\": \"Github Contribution Graph\",\n","            \"left\": \"center\",\n","            \"top\": \"30\",\n","            \"padding\": 5,\n","            \"itemGap\": 10\n","        }\n","    ],\n","    \"visualMap\": {\n","        \"show\": false,\n","        \"type\": \"piecewise\",\n","        \"min\": 500,\n","        \"max\": 20000,\n","        \"inRange\": {\n","            \"color\": [\n","                \"#EBEDF0\",\n","                \"#9BE9A8\",\n","                \"#40C463\",\n","                \"#30A14D\",\n","                \"#9BE9A8\"\n","            ]\n","        },\n","        \"calculable\": true,\n","        \"inverse\": false,\n","        \"splitNumber\": 5,\n","        \"orient\": \"horizontal\",\n","        \"showLabel\": true,\n","        \"itemWidth\": 20,\n","        \"itemHeight\": 14,\n","        \"borderWidth\": 0\n","    }\n","};\n","                chart_fcb366d4d463481ebdb45173cf8ed6f4.setOption(option_fcb366d4d463481ebdb45173cf8ed6f4);\n","        });\n","    </script>\n"],"text/plain":["<pyecharts.render.display.HTML at 0x108cb4160>"]},"execution_count":4,"metadata":{},"output_type":"execute_result"}],"source":["\n","(\n","    Calendar(init_opts=opts.InitOpts(width=\"1600px\", height=\"300px\"))\n","    .add(\n","        series_name=\"\",\n","        yaxis_data=data,\n","        calendar_opts=opts.CalendarOpts(\n","            pos_top=\"120\",\n","            range_=\"2021\",\n","            yearlabel_opts=opts.CalendarYearLabelOpts(is_show=False),\n","            daylabel_opts=opts.CalendarDayLabelOpts(name_map=\"cn\", first_day=1),\n","            monthlabel_opts=opts.CalendarMonthLabelOpts(name_map=\"cn\"),\n","        ),\n","    )\n","    .set_global_opts(\n","        title_opts=opts.TitleOpts(\n","            pos_top=\"30\", \n","            pos_left=\"center\", \n","            title=\"Github Contribution Graph\",\n","        ),\n","        visualmap_opts=opts.VisualMapOpts(\n","            min_=500,\n","            max_=20000, \n","            orient=\"horizontal\", \n","            is_piecewise=True,\n","            is_show=False,\n","            range_color=[\"#EBEDF0\", \"#9BE9A8\", \"#40C463\", \"#30A14D\",\"#9BE9A8\"],\n","        ),\n","    )\n","    .render_notebook()\n",")"]},{"cell_type":"markdown","metadata":{"collapsed":false,"id":"A4AA7E7C5C11499285476DF192310354","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"source":["## 上手使用"]},{"cell_type":"markdown","metadata":{"collapsed":false,"id":"6DA092BAA5F549E394A24AC7D67CA76B","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"source":["### 基本图形与渲染"]},{"cell_type":"code","execution_count":5,"metadata":{"collapsed":false,"id":"B01AE965709E4CB0968E9CFFB241584C","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"outputs":[{"data":{"text/html":["\n","<script>\n","    require.config({\n","        paths: {\n","            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n","        }\n","    });\n","</script>\n","\n","        <div id=\"8a62ea5633224eaea4974995c89b8205\" style=\"width:900px; height:500px;\"></div>\n","\n","<script>\n","        require(['echarts'], function(echarts) {\n","                var chart_8a62ea5633224eaea4974995c89b8205 = echarts.init(\n","                    document.getElementById('8a62ea5633224eaea4974995c89b8205'), 'white', {renderer: 'canvas'});\n","                var option_8a62ea5633224eaea4974995c89b8205 = {\n","    \"animation\": true,\n","    \"animationThreshold\": 2000,\n","    \"animationDuration\": 1000,\n","    \"animationEasing\": \"cubicOut\",\n","    \"animationDelay\": 0,\n","    \"animationDurationUpdate\": 300,\n","    \"animationEasingUpdate\": \"cubicOut\",\n","    \"animationDelayUpdate\": 0,\n","    \"color\": [\n","        \"#c23531\",\n","        \"#2f4554\",\n","        \"#61a0a8\",\n","        \"#d48265\",\n","        \"#749f83\",\n","        \"#ca8622\",\n","        \"#bda29a\",\n","        \"#6e7074\",\n","        \"#546570\",\n","        \"#c4ccd3\",\n","        \"#f05b72\",\n","        \"#ef5b9c\",\n","        \"#f47920\",\n","        \"#905a3d\",\n","        \"#fab27b\",\n","        \"#2a5caa\",\n","        \"#444693\",\n","        \"#726930\",\n","        \"#b2d235\",\n","        \"#6d8346\",\n","        \"#ac6767\",\n","        \"#1d953f\",\n","        \"#6950a1\",\n","        \"#918597\"\n","    ],\n","    \"series\": [\n","        {\n","            \"type\": \"bar\",\n","            \"name\": \"\\u5546\\u5bb6A\",\n","            \"legendHoverLink\": true,\n","            \"data\": [\n","                76,\n","                97,\n","                77,\n","                137,\n","                125,\n","                91,\n","                31\n","            ],\n","            \"showBackground\": false,\n","            \"barMinHeight\": 0,\n","            \"barCategoryGap\": \"20%\",\n","            \"barGap\": \"30%\",\n","            \"large\": false,\n","            \"largeThreshold\": 400,\n","            \"seriesLayoutBy\": \"column\",\n","            \"datasetIndex\": 0,\n","            \"clip\": true,\n","            \"zlevel\": 0,\n","            \"z\": 2,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            }\n","        }\n","    ],\n","    \"legend\": [\n","        {\n","            \"data\": [\n","                \"\\u5546\\u5bb6A\"\n","            ],\n","            \"selected\": {\n","                \"\\u5546\\u5bb6A\": true\n","            }\n","        }\n","    ],\n","    \"tooltip\": {\n","        \"show\": true,\n","        \"trigger\": \"item\",\n","        \"triggerOn\": \"mousemove|click\",\n","        \"axisPointer\": {\n","            \"type\": \"line\"\n","        },\n","        \"showContent\": true,\n","        \"alwaysShowContent\": false,\n","        \"showDelay\": 0,\n","        \"hideDelay\": 100,\n","        \"textStyle\": {\n","            \"fontSize\": 14\n","        },\n","        \"borderWidth\": 0,\n","        \"padding\": 5\n","    },\n","    \"xAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            },\n","            \"data\": [\n","                \"\\u886c\\u886b\",\n","                \"\\u6bdb\\u8863\",\n","                \"\\u9886\\u5e26\",\n","                \"\\u88e4\\u5b50\",\n","                \"\\u98ce\\u8863\",\n","                \"\\u9ad8\\u8ddf\\u978b\",\n","                \"\\u889c\\u5b50\"\n","            ]\n","        }\n","    ],\n","    \"yAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            }\n","        }\n","    ]\n","};\n","                chart_8a62ea5633224eaea4974995c89b8205.setOption(option_8a62ea5633224eaea4974995c89b8205);\n","        });\n","    </script>\n"],"text/plain":["<pyecharts.render.display.HTML at 0x109674d30>"]},"execution_count":5,"metadata":{},"output_type":"execute_result"}],"source":["from pyecharts.faker import Faker\n","from pyecharts.charts import Bar\n","\n","bar = (\n","    Bar()\n","    .add_xaxis(Faker.choose())\n","    .add_yaxis(\"商家A\", Faker.values())\n",")\n","\n","bar.render_notebook()"]},{"cell_type":"code","execution_count":6,"metadata":{"collapsed":false,"id":"BA3869FFE9F24523BDBC015154D36E7D","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"outputs":[{"data":{"text/html":["\n","<script>\n","    require.config({\n","        paths: {\n","            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n","        }\n","    });\n","</script>\n","\n","        <div id=\"ea569e4b90f544d4b58a460d622b6eb4\" style=\"width:900px; height:500px;\"></div>\n","\n","<script>\n","        require(['echarts'], function(echarts) {\n","                var chart_ea569e4b90f544d4b58a460d622b6eb4 = echarts.init(\n","                    document.getElementById('ea569e4b90f544d4b58a460d622b6eb4'), 'white', {renderer: 'canvas'});\n","                var option_ea569e4b90f544d4b58a460d622b6eb4 = {\n","    \"animation\": true,\n","    \"animationThreshold\": 2000,\n","    \"animationDuration\": 1000,\n","    \"animationEasing\": \"cubicOut\",\n","    \"animationDelay\": 0,\n","    \"animationDurationUpdate\": 300,\n","    \"animationEasingUpdate\": \"cubicOut\",\n","    \"animationDelayUpdate\": 0,\n","    \"color\": [\n","        \"#c23531\",\n","        \"#2f4554\",\n","        \"#61a0a8\",\n","        \"#d48265\",\n","        \"#749f83\",\n","        \"#ca8622\",\n","        \"#bda29a\",\n","        \"#6e7074\",\n","        \"#546570\",\n","        \"#c4ccd3\",\n","        \"#f05b72\",\n","        \"#ef5b9c\",\n","        \"#f47920\",\n","        \"#905a3d\",\n","        \"#fab27b\",\n","        \"#2a5caa\",\n","        \"#444693\",\n","        \"#726930\",\n","        \"#b2d235\",\n","        \"#6d8346\",\n","        \"#ac6767\",\n","        \"#1d953f\",\n","        \"#6950a1\",\n","        \"#918597\"\n","    ],\n","    \"series\": [\n","        {\n","            \"type\": \"bar\",\n","            \"name\": \"\\u5546\\u5bb6A\",\n","            \"legendHoverLink\": true,\n","            \"data\": [\n","                73,\n","                67,\n","                42,\n","                109,\n","                136,\n","                55,\n","                31\n","            ],\n","            \"showBackground\": false,\n","            \"barMinHeight\": 0,\n","            \"barCategoryGap\": \"20%\",\n","            \"barGap\": \"30%\",\n","            \"large\": false,\n","            \"largeThreshold\": 400,\n","            \"seriesLayoutBy\": \"column\",\n","            \"datasetIndex\": 0,\n","            \"clip\": true,\n","            \"zlevel\": 0,\n","            \"z\": 2,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            }\n","        },\n","        {\n","            \"type\": \"bar\",\n","            \"name\": \"\\u5546\\u5bb6B\",\n","            \"legendHoverLink\": true,\n","            \"data\": [\n","                24,\n","                73,\n","                64,\n","                48,\n","                22,\n","                36,\n","                56\n","            ],\n","            \"showBackground\": false,\n","            \"barMinHeight\": 0,\n","            \"barCategoryGap\": \"20%\",\n","            \"barGap\": \"30%\",\n","            \"large\": false,\n","            \"largeThreshold\": 400,\n","            \"seriesLayoutBy\": \"column\",\n","            \"datasetIndex\": 0,\n","            \"clip\": true,\n","            \"zlevel\": 0,\n","            \"z\": 2,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            }\n","        }\n","    ],\n","    \"legend\": [\n","        {\n","            \"data\": [\n","                \"\\u5546\\u5bb6A\",\n","                \"\\u5546\\u5bb6B\"\n","            ],\n","            \"selected\": {\n","                \"\\u5546\\u5bb6A\": true,\n","                \"\\u5546\\u5bb6B\": true\n","            }\n","        }\n","    ],\n","    \"tooltip\": {\n","        \"show\": true,\n","        \"trigger\": \"item\",\n","        \"triggerOn\": \"mousemove|click\",\n","        \"axisPointer\": {\n","            \"type\": \"line\"\n","        },\n","        \"showContent\": true,\n","        \"alwaysShowContent\": false,\n","        \"showDelay\": 0,\n","        \"hideDelay\": 100,\n","        \"textStyle\": {\n","            \"fontSize\": 14\n","        },\n","        \"borderWidth\": 0,\n","        \"padding\": 5\n","    },\n","    \"xAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            },\n","            \"data\": [\n","                \"\\u5c0f\\u7c73\",\n","                \"\\u4e09\\u661f\",\n","                \"\\u534e\\u4e3a\",\n","                \"\\u82f9\\u679c\",\n","                \"\\u9b45\\u65cf\",\n","                \"VIVO\",\n","                \"OPPO\"\n","            ]\n","        }\n","    ],\n","    \"yAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            }\n","        }\n","    ]\n","};\n","                chart_ea569e4b90f544d4b58a460d622b6eb4.setOption(option_ea569e4b90f544d4b58a460d622b6eb4);\n","        });\n","    </script>\n"],"text/plain":["<pyecharts.render.display.HTML at 0x1096756f0>"]},"execution_count":6,"metadata":{},"output_type":"execute_result"}],"source":["bar = (\n","    Bar()\n","    .add_xaxis(Faker.choose())\n","    .add_yaxis(\"商家A\", Faker.values())\n","    .add_yaxis(\"商家B\", Faker.values())\n",")\n","\n","bar.render_notebook()"]},{"cell_type":"code","execution_count":7,"metadata":{"collapsed":false,"id":"0E79AB40C362478FA65C48A87A255649","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"outputs":[{"data":{"text/html":["\n","<script>\n","    require.config({\n","        paths: {\n","            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n","        }\n","    });\n","</script>\n","\n","        <div id=\"45139655cffd4b8b97c144e6d9a3f228\" style=\"width:900px; height:500px;\"></div>\n","\n","<script>\n","        require(['echarts'], function(echarts) {\n","                var chart_45139655cffd4b8b97c144e6d9a3f228 = echarts.init(\n","                    document.getElementById('45139655cffd4b8b97c144e6d9a3f228'), 'white', {renderer: 'canvas'});\n","                var option_45139655cffd4b8b97c144e6d9a3f228 = {\n","    \"animation\": true,\n","    \"animationThreshold\": 2000,\n","    \"animationDuration\": 1000,\n","    \"animationEasing\": \"cubicOut\",\n","    \"animationDelay\": 0,\n","    \"animationDurationUpdate\": 300,\n","    \"animationEasingUpdate\": \"cubicOut\",\n","    \"animationDelayUpdate\": 0,\n","    \"color\": [\n","        \"#c23531\",\n","        \"#2f4554\",\n","        \"#61a0a8\",\n","        \"#d48265\",\n","        \"#749f83\",\n","        \"#ca8622\",\n","        \"#bda29a\",\n","        \"#6e7074\",\n","        \"#546570\",\n","        \"#c4ccd3\",\n","        \"#f05b72\",\n","        \"#ef5b9c\",\n","        \"#f47920\",\n","        \"#905a3d\",\n","        \"#fab27b\",\n","        \"#2a5caa\",\n","        \"#444693\",\n","        \"#726930\",\n","        \"#b2d235\",\n","        \"#6d8346\",\n","        \"#ac6767\",\n","        \"#1d953f\",\n","        \"#6950a1\",\n","        \"#918597\"\n","    ],\n","    \"series\": [\n","        {\n","            \"type\": \"line\",\n","            \"name\": \"\\u5546\\u5bb6A\",\n","            \"connectNulls\": false,\n","            \"symbolSize\": 4,\n","            \"showSymbol\": true,\n","            \"smooth\": false,\n","            \"clip\": true,\n","            \"step\": false,\n","            \"data\": [\n","                [\n","                    \"\\u886c\\u886b\",\n","                    66\n","                ],\n","                [\n","                    \"\\u6bdb\\u8863\",\n","                    96\n","                ],\n","                [\n","                    \"\\u9886\\u5e26\",\n","                    25\n","                ],\n","                [\n","                    \"\\u88e4\\u5b50\",\n","                    137\n","                ],\n","                [\n","                    \"\\u98ce\\u8863\",\n","                    114\n","                ],\n","                [\n","                    \"\\u9ad8\\u8ddf\\u978b\",\n","                    83\n","                ],\n","                [\n","                    \"\\u889c\\u5b50\",\n","                    135\n","                ]\n","            ],\n","            \"hoverAnimation\": true,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            },\n","            \"lineStyle\": {\n","                \"show\": true,\n","                \"width\": 1,\n","                \"opacity\": 1,\n","                \"curveness\": 0,\n","                \"type\": \"solid\"\n","            },\n","            \"areaStyle\": {\n","                \"opacity\": 0\n","            },\n","            \"zlevel\": 0,\n","            \"z\": 0\n","        },\n","        {\n","            \"type\": \"line\",\n","            \"name\": \"\\u5546\\u5bb6B\",\n","            \"connectNulls\": false,\n","            \"symbolSize\": 4,\n","            \"showSymbol\": true,\n","            \"smooth\": false,\n","            \"clip\": true,\n","            \"step\": false,\n","            \"data\": [\n","                [\n","                    \"\\u886c\\u886b\",\n","                    144\n","                ],\n","                [\n","                    \"\\u6bdb\\u8863\",\n","                    146\n","                ],\n","                [\n","                    \"\\u9886\\u5e26\",\n","                    71\n","                ],\n","                [\n","                    \"\\u88e4\\u5b50\",\n","                    43\n","                ],\n","                [\n","                    \"\\u98ce\\u8863\",\n","                    83\n","                ],\n","                [\n","                    \"\\u9ad8\\u8ddf\\u978b\",\n","                    29\n","                ],\n","                [\n","                    \"\\u889c\\u5b50\",\n","                    81\n","                ]\n","            ],\n","            \"hoverAnimation\": true,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            },\n","            \"lineStyle\": {\n","                \"show\": true,\n","                \"width\": 1,\n","                \"opacity\": 1,\n","                \"curveness\": 0,\n","                \"type\": \"solid\"\n","            },\n","            \"areaStyle\": {\n","                \"opacity\": 0\n","            },\n","            \"zlevel\": 0,\n","            \"z\": 0\n","        }\n","    ],\n","    \"legend\": [\n","        {\n","            \"data\": [\n","                \"\\u5546\\u5bb6A\",\n","                \"\\u5546\\u5bb6B\"\n","            ],\n","            \"selected\": {\n","                \"\\u5546\\u5bb6A\": true,\n","                \"\\u5546\\u5bb6B\": true\n","            }\n","        }\n","    ],\n","    \"tooltip\": {\n","        \"show\": true,\n","        \"trigger\": \"item\",\n","        \"triggerOn\": \"mousemove|click\",\n","        \"axisPointer\": {\n","            \"type\": \"line\"\n","        },\n","        \"showContent\": true,\n","        \"alwaysShowContent\": false,\n","        \"showDelay\": 0,\n","        \"hideDelay\": 100,\n","        \"textStyle\": {\n","            \"fontSize\": 14\n","        },\n","        \"borderWidth\": 0,\n","        \"padding\": 5\n","    },\n","    \"xAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            },\n","            \"data\": [\n","                \"\\u886c\\u886b\",\n","                \"\\u6bdb\\u8863\",\n","                \"\\u9886\\u5e26\",\n","                \"\\u88e4\\u5b50\",\n","                \"\\u98ce\\u8863\",\n","                \"\\u9ad8\\u8ddf\\u978b\",\n","                \"\\u889c\\u5b50\"\n","            ]\n","        }\n","    ],\n","    \"yAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            }\n","        }\n","    ]\n","};\n","                chart_45139655cffd4b8b97c144e6d9a3f228.setOption(option_45139655cffd4b8b97c144e6d9a3f228);\n","        });\n","    </script>\n"],"text/plain":["<pyecharts.render.display.HTML at 0x1096773d0>"]},"execution_count":7,"metadata":{},"output_type":"execute_result"}],"source":["from pyecharts.charts import Line\n","\n","line = (\n","    Line()\n","    .add_xaxis(Faker.choose())\n","    .add_yaxis(\"商家A\", Faker.values())\n","    .add_yaxis(\"商家B\", Faker.values())\n",")\n","\n","line.render_notebook()"]},{"cell_type":"code","execution_count":8,"metadata":{"collapsed":false,"id":"C25FB3D5A8D5461EADB367241366248A","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"outputs":[{"data":{"text/html":["\n","<script>\n","    require.config({\n","        paths: {\n","            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n","        }\n","    });\n","</script>\n","\n","        <div id=\"81d3ca60fe40486b8d699d60a06b39aa\" style=\"width:900px; height:500px;\"></div>\n","\n","<script>\n","        require(['echarts'], function(echarts) {\n","                var chart_81d3ca60fe40486b8d699d60a06b39aa = echarts.init(\n","                    document.getElementById('81d3ca60fe40486b8d699d60a06b39aa'), 'white', {renderer: 'canvas'});\n","                var option_81d3ca60fe40486b8d699d60a06b39aa = {\n","    \"animation\": true,\n","    \"animationThreshold\": 2000,\n","    \"animationDuration\": 1000,\n","    \"animationEasing\": \"cubicOut\",\n","    \"animationDelay\": 0,\n","    \"animationDurationUpdate\": 300,\n","    \"animationEasingUpdate\": \"cubicOut\",\n","    \"animationDelayUpdate\": 0,\n","    \"color\": [\n","        \"#c23531\",\n","        \"#2f4554\",\n","        \"#61a0a8\",\n","        \"#d48265\",\n","        \"#749f83\",\n","        \"#ca8622\",\n","        \"#bda29a\",\n","        \"#6e7074\",\n","        \"#546570\",\n","        \"#c4ccd3\",\n","        \"#f05b72\",\n","        \"#ef5b9c\",\n","        \"#f47920\",\n","        \"#905a3d\",\n","        \"#fab27b\",\n","        \"#2a5caa\",\n","        \"#444693\",\n","        \"#726930\",\n","        \"#b2d235\",\n","        \"#6d8346\",\n","        \"#ac6767\",\n","        \"#1d953f\",\n","        \"#6950a1\",\n","        \"#918597\"\n","    ],\n","    \"series\": [\n","        {\n","            \"type\": \"bar\",\n","            \"name\": \"\\u5546\\u5bb6A\",\n","            \"xAxisIndex\": 0,\n","            \"yAxisIndex\": 0,\n","            \"legendHoverLink\": true,\n","            \"data\": [\n","                73,\n","                67,\n","                42,\n","                109,\n","                136,\n","                55,\n","                31\n","            ],\n","            \"showBackground\": false,\n","            \"barMinHeight\": 0,\n","            \"barCategoryGap\": \"20%\",\n","            \"barGap\": \"30%\",\n","            \"large\": false,\n","            \"largeThreshold\": 400,\n","            \"seriesLayoutBy\": \"column\",\n","            \"datasetIndex\": 0,\n","            \"clip\": true,\n","            \"zlevel\": 0,\n","            \"z\": 2,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            }\n","        },\n","        {\n","            \"type\": \"bar\",\n","            \"name\": \"\\u5546\\u5bb6B\",\n","            \"xAxisIndex\": 0,\n","            \"yAxisIndex\": 0,\n","            \"legendHoverLink\": true,\n","            \"data\": [\n","                24,\n","                73,\n","                64,\n","                48,\n","                22,\n","                36,\n","                56\n","            ],\n","            \"showBackground\": false,\n","            \"barMinHeight\": 0,\n","            \"barCategoryGap\": \"20%\",\n","            \"barGap\": \"30%\",\n","            \"large\": false,\n","            \"largeThreshold\": 400,\n","            \"seriesLayoutBy\": \"column\",\n","            \"datasetIndex\": 0,\n","            \"clip\": true,\n","            \"zlevel\": 0,\n","            \"z\": 2,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            }\n","        },\n","        {\n","            \"type\": \"line\",\n","            \"name\": \"\\u5546\\u5bb6A\",\n","            \"connectNulls\": false,\n","            \"xAxisIndex\": 1,\n","            \"yAxisIndex\": 1,\n","            \"symbolSize\": 4,\n","            \"showSymbol\": true,\n","            \"smooth\": false,\n","            \"clip\": true,\n","            \"step\": false,\n","            \"data\": [\n","                [\n","                    \"\\u886c\\u886b\",\n","                    66\n","                ],\n","                [\n","                    \"\\u6bdb\\u8863\",\n","                    96\n","                ],\n","                [\n","                    \"\\u9886\\u5e26\",\n","                    25\n","                ],\n","                [\n","                    \"\\u88e4\\u5b50\",\n","                    137\n","                ],\n","                [\n","                    \"\\u98ce\\u8863\",\n","                    114\n","                ],\n","                [\n","                    \"\\u9ad8\\u8ddf\\u978b\",\n","                    83\n","                ],\n","                [\n","                    \"\\u889c\\u5b50\",\n","                    135\n","                ]\n","            ],\n","            \"hoverAnimation\": true,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            },\n","            \"lineStyle\": {\n","                \"show\": true,\n","                \"width\": 1,\n","                \"opacity\": 1,\n","                \"curveness\": 0,\n","                \"type\": \"solid\"\n","            },\n","            \"areaStyle\": {\n","                \"opacity\": 0\n","            },\n","            \"zlevel\": 0,\n","            \"z\": 0\n","        },\n","        {\n","            \"type\": \"line\",\n","            \"name\": \"\\u5546\\u5bb6B\",\n","            \"connectNulls\": false,\n","            \"xAxisIndex\": 1,\n","            \"yAxisIndex\": 1,\n","            \"symbolSize\": 4,\n","            \"showSymbol\": true,\n","            \"smooth\": false,\n","            \"clip\": true,\n","            \"step\": false,\n","            \"data\": [\n","                [\n","                    \"\\u886c\\u886b\",\n","                    144\n","                ],\n","                [\n","                    \"\\u6bdb\\u8863\",\n","                    146\n","                ],\n","                [\n","                    \"\\u9886\\u5e26\",\n","                    71\n","                ],\n","                [\n","                    \"\\u88e4\\u5b50\",\n","                    43\n","                ],\n","                [\n","                    \"\\u98ce\\u8863\",\n","                    83\n","                ],\n","                [\n","                    \"\\u9ad8\\u8ddf\\u978b\",\n","                    29\n","                ],\n","                [\n","                    \"\\u889c\\u5b50\",\n","                    81\n","                ]\n","            ],\n","            \"hoverAnimation\": true,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"top\",\n","                \"margin\": 8\n","            },\n","            \"lineStyle\": {\n","                \"show\": true,\n","                \"width\": 1,\n","                \"opacity\": 1,\n","                \"curveness\": 0,\n","                \"type\": \"solid\"\n","            },\n","            \"areaStyle\": {\n","                \"opacity\": 0\n","            },\n","            \"zlevel\": 0,\n","            \"z\": 0\n","        }\n","    ],\n","    \"legend\": [\n","        {\n","            \"data\": [\n","                \"\\u5546\\u5bb6A\",\n","                \"\\u5546\\u5bb6B\"\n","            ],\n","            \"selected\": {\n","                \"\\u5546\\u5bb6A\": true,\n","                \"\\u5546\\u5bb6B\": true\n","            }\n","        },\n","        {\n","            \"data\": [\n","                \"\\u5546\\u5bb6A\",\n","                \"\\u5546\\u5bb6B\"\n","            ],\n","            \"selected\": {\n","                \"\\u5546\\u5bb6A\": true,\n","                \"\\u5546\\u5bb6B\": true\n","            }\n","        }\n","    ],\n","    \"tooltip\": {\n","        \"show\": true,\n","        \"trigger\": \"item\",\n","        \"triggerOn\": \"mousemove|click\",\n","        \"axisPointer\": {\n","            \"type\": \"line\"\n","        },\n","        \"showContent\": true,\n","        \"alwaysShowContent\": false,\n","        \"showDelay\": 0,\n","        \"hideDelay\": 100,\n","        \"textStyle\": {\n","            \"fontSize\": 14\n","        },\n","        \"borderWidth\": 0,\n","        \"padding\": 5\n","    },\n","    \"xAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            },\n","            \"data\": [\n","                \"\\u5c0f\\u7c73\",\n","                \"\\u4e09\\u661f\",\n","                \"\\u534e\\u4e3a\",\n","                \"\\u82f9\\u679c\",\n","                \"\\u9b45\\u65cf\",\n","                \"VIVO\",\n","                \"OPPO\"\n","            ]\n","        },\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 1,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            },\n","            \"data\": [\n","                \"\\u886c\\u886b\",\n","                \"\\u6bdb\\u8863\",\n","                \"\\u9886\\u5e26\",\n","                \"\\u88e4\\u5b50\",\n","                \"\\u98ce\\u8863\",\n","                \"\\u9ad8\\u8ddf\\u978b\",\n","                \"\\u889c\\u5b50\"\n","            ]\n","        }\n","    ],\n","    \"yAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            }\n","        },\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 1,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            }\n","        }\n","    ],\n","    \"grid\": [\n","        {\n","            \"show\": false,\n","            \"zlevel\": 0,\n","            \"z\": 2,\n","            \"bottom\": \"60%\",\n","            \"containLabel\": false,\n","            \"backgroundColor\": \"transparent\",\n","            \"borderColor\": \"#ccc\",\n","            \"borderWidth\": 1\n","        },\n","        {\n","            \"show\": false,\n","            \"zlevel\": 0,\n","            \"z\": 2,\n","            \"top\": \"60%\",\n","            \"containLabel\": false,\n","            \"backgroundColor\": \"transparent\",\n","            \"borderColor\": \"#ccc\",\n","            \"borderWidth\": 1\n","        }\n","    ],\n","    \"title\": [\n","        {\n","            \"padding\": 5,\n","            \"itemGap\": 10\n","        },\n","        {\n","            \"padding\": 5,\n","            \"itemGap\": 10\n","        }\n","    ]\n","};\n","                chart_81d3ca60fe40486b8d699d60a06b39aa.setOption(option_81d3ca60fe40486b8d699d60a06b39aa);\n","        });\n","    </script>\n"],"text/plain":["<pyecharts.render.display.HTML at 0x1096759f0>"]},"execution_count":8,"metadata":{},"output_type":"execute_result"}],"source":["import pyecharts.options as opts\n","from pyecharts.charts import Grid\n","\n","\n","grid = (\n","    Grid()\n","    .add(bar, opts.GridOpts(pos_bottom=\"60%\"))\n","    .add(line, opts.GridOpts(pos_top=\"60%\"))\n",")\n","\n","grid.render_notebook()"]},{"cell_type":"markdown","metadata":{"collapsed":false,"id":"7C93FB605C3F44D9A8668CF36D9FE7AB","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"source":["### 全局参数与系列参数"]},{"cell_type":"code","execution_count":9,"metadata":{"collapsed":false,"id":"B76947A780CE47FDB822A13A83C8EB11","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"slide"},"tags":[],"trusted":true},"outputs":[{"data":{"text/html":["\n","<script>\n","    require.config({\n","        paths: {\n","            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n","        }\n","    });\n","</script>\n","\n","        <div id=\"bb8c2918d8844d36aad81784e21f737c\" style=\"width:1200px; height:600px;\"></div>\n","\n","<script>\n","        require(['echarts'], function(echarts) {\n","                var chart_bb8c2918d8844d36aad81784e21f737c = echarts.init(\n","                    document.getElementById('bb8c2918d8844d36aad81784e21f737c'), 'white', {renderer: 'canvas'});\n","                var option_bb8c2918d8844d36aad81784e21f737c = {\n","    \"animation\": true,\n","    \"animationThreshold\": 2000,\n","    \"animationDuration\": 1000,\n","    \"animationEasing\": \"cubicOut\",\n","    \"animationDelay\": 0,\n","    \"animationDurationUpdate\": 300,\n","    \"animationEasingUpdate\": \"cubicOut\",\n","    \"animationDelayUpdate\": 0,\n","    \"color\": [\n","        \"#c23531\",\n","        \"#2f4554\",\n","        \"#61a0a8\",\n","        \"#d48265\",\n","        \"#749f83\",\n","        \"#ca8622\",\n","        \"#bda29a\",\n","        \"#6e7074\",\n","        \"#546570\",\n","        \"#c4ccd3\",\n","        \"#f05b72\",\n","        \"#ef5b9c\",\n","        \"#f47920\",\n","        \"#905a3d\",\n","        \"#fab27b\",\n","        \"#2a5caa\",\n","        \"#444693\",\n","        \"#726930\",\n","        \"#b2d235\",\n","        \"#6d8346\",\n","        \"#ac6767\",\n","        \"#1d953f\",\n","        \"#6950a1\",\n","        \"#918597\"\n","    ],\n","    \"series\": [\n","        {\n","            \"type\": \"bar\",\n","            \"name\": \"\\u5546\\u5bb6A\",\n","            \"legendHoverLink\": true,\n","            \"data\": [\n","                64,\n","                79,\n","                143,\n","                72,\n","                41,\n","                46,\n","                88\n","            ],\n","            \"showBackground\": false,\n","            \"barMinHeight\": 0,\n","            \"barCategoryGap\": \"20%\",\n","            \"barGap\": \"30%\",\n","            \"large\": false,\n","            \"largeThreshold\": 400,\n","            \"seriesLayoutBy\": \"column\",\n","            \"datasetIndex\": 0,\n","            \"clip\": true,\n","            \"zlevel\": 0,\n","            \"z\": 2,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"inside\",\n","                \"margin\": 8,\n","                \"fontSize\": \"14\",\n","                \"fontStyle\": \"italic\"\n","            },\n","            \"itemStyle\": {\n","                \"opacity\": 0.8\n","            },\n","            \"rippleEffect\": {\n","                \"show\": true,\n","                \"brushType\": \"stroke\",\n","                \"scale\": 2.5,\n","                \"period\": 4\n","            }\n","        },\n","        {\n","            \"type\": \"bar\",\n","            \"name\": \"\\u5546\\u5bb6B\",\n","            \"legendHoverLink\": true,\n","            \"data\": [\n","                79,\n","                23,\n","                39,\n","                80,\n","                78,\n","                92,\n","                49\n","            ],\n","            \"showBackground\": false,\n","            \"barMinHeight\": 0,\n","            \"barCategoryGap\": \"20%\",\n","            \"barGap\": \"30%\",\n","            \"large\": false,\n","            \"largeThreshold\": 400,\n","            \"seriesLayoutBy\": \"column\",\n","            \"datasetIndex\": 0,\n","            \"clip\": true,\n","            \"zlevel\": 0,\n","            \"z\": 2,\n","            \"label\": {\n","                \"show\": true,\n","                \"position\": \"inside\",\n","                \"margin\": 8,\n","                \"fontSize\": \"14\",\n","                \"fontStyle\": \"italic\"\n","            },\n","            \"itemStyle\": {\n","                \"opacity\": 0.8\n","            },\n","            \"rippleEffect\": {\n","                \"show\": true,\n","                \"brushType\": \"stroke\",\n","                \"scale\": 2.5,\n","                \"period\": 4\n","            }\n","        }\n","    ],\n","    \"legend\": [\n","        {\n","            \"data\": [\n","                \"\\u5546\\u5bb6A\",\n","                \"\\u5546\\u5bb6B\"\n","            ],\n","            \"selected\": {\n","                \"\\u5546\\u5bb6A\": true,\n","                \"\\u5546\\u5bb6B\": true\n","            },\n","            \"show\": true,\n","            \"top\": \"5%\",\n","            \"padding\": 5,\n","            \"itemGap\": 10,\n","            \"itemWidth\": 25,\n","            \"itemHeight\": 14\n","        }\n","    ],\n","    \"tooltip\": {\n","        \"show\": true,\n","        \"trigger\": \"item\",\n","        \"triggerOn\": \"mousemove|click\",\n","        \"axisPointer\": {\n","            \"type\": \"line\"\n","        },\n","        \"showContent\": true,\n","        \"alwaysShowContent\": false,\n","        \"showDelay\": 0,\n","        \"hideDelay\": 100,\n","        \"textStyle\": {\n","            \"fontSize\": 14\n","        },\n","        \"borderWidth\": 0,\n","        \"padding\": 5\n","    },\n","    \"xAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            },\n","            \"data\": [\n","                \"\\u54c8\\u58eb\\u5947\",\n","                \"\\u8428\\u6469\\u8036\",\n","                \"\\u6cf0\\u8fea\",\n","                \"\\u91d1\\u6bdb\",\n","                \"\\u7267\\u7f8a\\u72ac\",\n","                \"\\u5409\\u5a03\\u5a03\",\n","                \"\\u67ef\\u57fa\"\n","            ]\n","        }\n","    ],\n","    \"yAxis\": [\n","        {\n","            \"show\": true,\n","            \"scale\": false,\n","            \"nameLocation\": \"end\",\n","            \"nameGap\": 15,\n","            \"gridIndex\": 0,\n","            \"inverse\": false,\n","            \"offset\": 0,\n","            \"splitNumber\": 5,\n","            \"minInterval\": 0,\n","            \"splitLine\": {\n","                \"show\": false,\n","                \"lineStyle\": {\n","                    \"show\": true,\n","                    \"width\": 1,\n","                    \"opacity\": 1,\n","                    \"curveness\": 0,\n","                    \"type\": \"solid\"\n","                }\n","            }\n","        }\n","    ],\n","    \"title\": [\n","        {\n","            \"text\": \"Pyecharts \\u67f1\\u72b6\\u56fe\\u793a\\u4f8b\",\n","            \"left\": \"center\",\n","            \"padding\": 5,\n","            \"itemGap\": 10\n","        }\n","    ],\n","    \"toolbox\": {\n","        \"show\": true,\n","        \"orient\": \"horizontal\",\n","        \"itemSize\": 15,\n","        \"itemGap\": 10,\n","        \"left\": \"center\",\n","        \"top\": \"10%\",\n","        \"feature\": {\n","            \"saveAsImage\": {\n","                \"type\": \"png\",\n","                \"backgroundColor\": \"auto\",\n","                \"connectedBackgroundColor\": \"#fff\",\n","                \"show\": true,\n","                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n","                \"pixelRatio\": 1\n","            },\n","            \"restore\": {\n","                \"show\": true,\n","                \"title\": \"\\u8fd8\\u539f\"\n","            },\n","            \"dataView\": {\n","                \"show\": true,\n","                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n","                \"readOnly\": false,\n","                \"lang\": [\n","                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n","                    \"\\u5173\\u95ed\",\n","                    \"\\u5237\\u65b0\"\n","                ],\n","                \"backgroundColor\": \"#fff\",\n","                \"textareaColor\": \"#fff\",\n","                \"textareaBorderColor\": \"#333\",\n","                \"textColor\": \"#000\",\n","                \"buttonColor\": \"#c23531\",\n","                \"buttonTextColor\": \"#fff\"\n","            },\n","            \"dataZoom\": {\n","                \"show\": true,\n","                \"title\": {\n","                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n","                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n","                },\n","                \"icon\": {},\n","                \"xAxisIndex\": false,\n","                \"yAxisIndex\": false,\n","                \"filterMode\": \"filter\"\n","            },\n","            \"magicType\": {\n","                \"show\": true,\n","                \"type\": [\n","                    \"line\",\n","                    \"bar\",\n","                    \"stack\",\n","                    \"tiled\"\n","                ],\n","                \"title\": {\n","                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n","                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n","                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n","                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n","                },\n","                \"icon\": {}\n","            },\n","            \"brush\": {\n","                \"icon\": {},\n","                \"title\": {\n","                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n","                    \"polygon\": \"\\u5708\\u9009\",\n","                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n","                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n","                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n","                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n","                }\n","            }\n","        }\n","    }\n","};\n","                chart_bb8c2918d8844d36aad81784e21f737c.setOption(option_bb8c2918d8844d36aad81784e21f737c);\n","        });\n","    </script>\n"],"text/plain":["<pyecharts.render.display.HTML at 0x1095250f0>"]},"execution_count":9,"metadata":{},"output_type":"execute_result"}],"source":["import random\n","random.seed(233)\n","\n","\n","import pyecharts.options as opts\n","\n","bar = (\n","    # Bar()\n","    Bar(init_opts=opts.InitOpts(width=\"1200px\", height=\"600px\"))\n","    .add_xaxis(Faker.choose())\n","    .add_yaxis(\"商家A\", Faker.values())\n","    .add_yaxis(\"商家B\", Faker.values())\n","    .set_global_opts(\n","        title_opts=opts.TitleOpts(\n","            title=\"Pyecharts 柱状图示例\", \n","            pos_left=\"center\",\n","        ),\n","        legend_opts=opts.LegendOpts(pos_top=\"5%\"),\n","        toolbox_opts=opts.ToolboxOpts(\n","            is_show=True, \n","            pos_left=\"center\", \n","            pos_top=\"10%\",\n","        ),\n","    )\n","    .set_series_opts(\n","        itemstyle_opts=opts.ItemStyleOpts(opacity=0.8),\n","        label_opts=opts.LabelOpts(\n","            position=\"inside\", \n","            font_size=\"14\", \n","            font_style=\"italic\",\n","        )\n","    )\n",")\n","\n","bar.render_notebook()"]},{"cell_type":"code","execution_count":null,"metadata":{"collapsed":false,"id":"786FB41F3E104DD2AD5A3713C4D3B516","jupyter":{},"notebookId":"62e76061f417226fda5ada4f","scrolled":false,"slideshow":{"slide_type":"skip"},"tags":[],"trusted":true},"outputs":[],"source":[]}],"metadata":{"kernelspec":{"display_name":"Python 3.10.4 64-bit","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.4"},"vscode":{"interpreter":{"hash":"aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"}}},"nbformat":4,"nbformat_minor":2}
